//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

package org.ryzom.nel.misc;

public class CRect {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CRect(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CRect obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CRect(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CRect() {
    this(nelmiscJNI.new_CRect__SWIG_0(), true);
  }

  public CRect(int x, int y, long width, long height) {
    this(nelmiscJNI.new_CRect__SWIG_1(x, y, width, height), true);
  }

  public CRect(int x, int y) {
    this(nelmiscJNI.new_CRect__SWIG_2(x, y), true);
  }

  public void setWH(int x, int y, long width, long height) {
    nelmiscJNI.CRect_setWH(swigCPtr, this, x, y, width, height);
  }

  public void set(int x0, int y0, int x1, int y1) {
    nelmiscJNI.CRect_set(swigCPtr, this, x0, y0, x1, y1);
  }

  public void extend(int x, int y) {
    nelmiscJNI.CRect_extend(swigCPtr, this, x, y);
  }

  public int left() {
    return nelmiscJNI.CRect_left(swigCPtr, this);
  }

  public int right() {
    return nelmiscJNI.CRect_right(swigCPtr, this);
  }

  public int top() {
    return nelmiscJNI.CRect_top(swigCPtr, this);
  }

  public int bottom() {
    return nelmiscJNI.CRect_bottom(swigCPtr, this);
  }

  public int getXCenter() {
    return nelmiscJNI.CRect_getXCenter(swigCPtr, this);
  }

  public int getYCenter() {
    return nelmiscJNI.CRect_getYCenter(swigCPtr, this);
  }

  public void setX(int value) {
    nelmiscJNI.CRect_X_set(swigCPtr, this, value);
  }

  public int getX() {
    return nelmiscJNI.CRect_X_get(swigCPtr, this);
  }

  public void setY(int value) {
    nelmiscJNI.CRect_Y_set(swigCPtr, this, value);
  }

  public int getY() {
    return nelmiscJNI.CRect_Y_get(swigCPtr, this);
  }

  public void setWidth(long value) {
    nelmiscJNI.CRect_Width_set(swigCPtr, this, value);
  }

  public long getWidth() {
    return nelmiscJNI.CRect_Width_get(swigCPtr, this);
  }

  public void setHeight(long value) {
    nelmiscJNI.CRect_Height_set(swigCPtr, this, value);
  }

  public long getHeight() {
    return nelmiscJNI.CRect_Height_get(swigCPtr, this);
  }

}
